package com.woniu.learnfile.service.Impl;

import com.woniu.learnfile.service.DownloadFileService;
import com.woniu.learnfile.utils.FileUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * created  by woniu201
 * created in 2018/3/16
 */
@Component
public class DownloadFileServiceImpl implements DownloadFileService {

    @Value(value="${file.path}")
    private  String filePath;

    @Override
    public byte[] downloadFileService( String fileName) throws Exception {

        FileUtil fileUtil = new FileUtil();
        return fileUtil.readFile(filePath, fileName);
    }
}
